<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
  <div id="app"></div>

  <script src="../js/vue.js"></script>
  <script>
    // 定义一个mixin混入对象
    const myMixin = {
      data(){
        return {
          message: '你好Vue3!',
        }
      },
      methods: {
        hello() {
          alert('Hello');
        }
      },
    }



     // 1.创建Vue的实例对象
     const app = Vue.createApp({

       // 混入
       mixins: [myMixin],

      template: `
        <div>
          <h1>{{message}}</h1>
          <button @click="hello">打个招呼</button>
        </div>
      `
     });

     app.mount('#app');
  </script>
</body>
</html>